<?php
/**
 * @description : get the country list.
 * @class-name : GetCountrySetting().
 * @author : stephen.mo
 * @date : 2010-04-21
 */
require_once 'TVB/mytvplus/MstatReportTool/common/countryClass.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/getStatsClass.class.php';
require_once 'TVB/mytvplus/MstatReportTool/common/statClass.php';
class GetCountrySetting extends BaseAction {

    public function execute() {
        $region = $_GET['region'];
        $flag = true;
        $regions = getStatsClass::getRegions($flag);
        $r = $regions[$region];
        echo json_encode($r);

        /**
            $r = getStatsClass::getRegion($region);
            echo json_encode($r);
        */
       /**
        $q = isset($_GET['q']) ? $_GET['q'] : '';
        $countrys = explode(',', $q);
        
        $len = count($countrys);
        $var = substr($countrys[$len-1], 0, 1);
        
        $r = isset(countryClass::$$var) ? countryClass::$$var : array();
        $keys = array_keys($r);
        $values = array_values($r);
        foreach($values as $k=>$v){
            $values[$k] = ucwords(strtolower($v));
        }
        
        //echo json_encode($values);
        echo implode("\r\n", $values);
        */
    }
}


?>